Python Real-Time Dictionary Interview Questions - Handling Duplicates In List